package com.zj.springcloud.service;


import com.zj.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Component
//服务降级 指定工厂
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT-8001", fallbackFactory = DeptClientServiceFailBackFactory.class) //从提供者拿
public interface DeptClientService {

    @GetMapping("/dept/get/{id}")
    public Dept queryById(@PathVariable("id") Long id);

    @GetMapping("/dept/list")
    public List<Dept> queryAll();


   // @GetMapping(value = "/dept/add",consumes = "application/json")
    @RequestMapping(value = "/dept/add",method = RequestMethod.POST, consumes = "application/json")
    public boolean addDept(Dept dept);


}
